#include <stdio.h>
#include <stdlib.h>
#define OK 1
#define ERROR 0
#define OVERFLOW -2
typedef struct se
{
    int data;
    se *next;
} SElem;
typedef struct
{
    SElem *base;
    SElem *top;
} Stack;
int InitStack(Stack *s)
{ /*初始化栈*/
    s->base = (SElem *)malloc(sizeof(SElem));
    if (!s->base)
        return (OVERFLOW);
    s->top = s->base;
    return (OK);
}
int Push(Stack *s, int x)
{ /*插入栈顶元素baidu*/
    SElem *p = (SElem *)malloc(sizeof(SElem));
    if (!p)
        return (ERROR);
    p->data = x;
    p->next = s->top;
    s->top = p;
    return (OK);
}
int Pop(Stack *s)
{ /*弹出栈顶元素*/
    if (s->top == s->base)
    {
        printf("ERROR\n");
        return (ERROR);
    }
    int x;
    SElem *t;
    x = s->top->data;
    t = s->top;
    s->top = s->top->next;
    free(t);
    return (x);
}
int main()
{
    int i, j;
    Stack *s = (Stack *)malloc(sizeof(Stack));
    InitStack(s);
    scanf("%d", &i);
    while (i != 0)
    {
        j = i % 2;
        i = i / 2;
        if (j == 0)
            Push(s, 0);
        else
            Push(s, 1);
    }
    while (s->top != s->base)
        printf("%d", Pop(s));
    printf("\n");
    system("pause");
    
}